package com.bckj.fastboot.paid.biz.interfaces.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.bckj.fastboot.paid.biz.application.service.PayService;
import com.bckj.fastboot.paid.api.model.PayRequest;
import com.bckj.fastboot.paid.api.model.PayResponse;
import com.bckj.fastboot.paid.api.service.PayRemoteService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("pay")
public class PayController implements PayRemoteService {

    private final PayService payService;

    /**
     * 支付
     */
    @SaIgnore
    @PostMapping
    public PayResponse pay(PayRequest request) {
        return payService.pay(request);
    }
}
